]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Add exception to no-loop-func rule
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 15 Sep 2019 00:51:40 +0000 (02:51 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 11 Nov 2019 23:51:17 +0000 (23:51 +0000)
Modifying variables from an outer scope in functions created in a loop
is considered problematic by eslint, because the variable value in the
resulting closure is often not what the coder intended.

In this particular case however, the scoping is correct, so add a comment
to disable the rule locally.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818

js/ui/background.js

index 4d5d1324914e7735544723c6f63b406c5169879c..f7506dec4b2a5aa8213fe49131f7ee9a7ab26750 100644 (file)
@@ -403,6 +403,7 @@ var Background = GObject.registerClass({
                 if (numPendingImages == 0)
                     finish();
             } else {
+                // eslint-disable-next-line no-loop-func
                 let id = image.connect('loaded', () => {
                     image.disconnect(id);
                     numPendingImages--;